#!/bin/bash
path='/var/log/nginx'
mv $path/access.log  $path/access.log_$(date '+%Y-%m-%d' -d "yesterday")
kill -USR1 $(cat /run/nginx.pid)
rm $path/access.log_$(date '+%Y-%m-%d' -d "-7 day")
